
<script setup lang="ts">
    import { ref } from 'vue';
    import { accountLogin } from '@/utils/api/index';
    const value = ref('');
    const password = ref('');

    const login = () => {
        console.log(value.value, password.value);
        accountLogin({
            account: value.value,
            password: password.value,
        }).then((res:any) => {
            console.log(res);
        });
    };
</script>

<template >
    <div class="login-box">
        <van-cell-group inset>
            <!-- 输入账号 -->
            <van-field v-model="value" label="账号" placeholder="请输入用户名" />
            <!-- 输入密码 -->
            <van-field v-model="password" type="password" label="请输入密码" />
        </van-cell-group>

        <div class="button-group">
            <van-button type="primary" @click="login">登录</van-button>
        </div>
     
    </div>
</template>

<style lang="less" scoped>
    .login-box{
        padding-top: 200px;
        .button-group{
            text-align: center;
            margin-top: 20px;
        }
    }
    
</style>